package com.huang.article.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.huang.resp.CommonResult;
import com.huang.util.OauthUtils;
import com.huang.vo.LoginUserInfo;

/**
 * @author han
 * @since 2022-01-19 16:36:42
 */
@RestController
@RequestMapping("user")
public class UserController {

	@GetMapping("info")
	public CommonResult info() {
		LoginUserInfo currentUser = OauthUtils.getCurrentUser();
//		HttpServletRequest request = RequestContextUtils.getRequest();
//		String header = request.getHeader(Common.Token.JWT_PAYLOAD_KEY);
//		Principal userPrincipal = request.getUserPrincipal();
//		Object attribute = request.getAttribute(Common.Token.JWT_PAYLOAD_KEY);
		return CommonResult.success(currentUser);
	}
}
